<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 
	<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache"> 
	<META HTTP-EQUIV="Expires" CONTENT="0"> 
	<title>我的贷款</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="../../css/font_eolqem241z66flxr.css" media="all" />
	<link rel="stylesheet" href="../../css/news.css" media="all" />
	<script src="../../layui/js/angular.js"></script>
	<script type="text/javascript" src="../../layui/layui/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="../../layui/layui/GetPath.js"></script>
	<script src="../../layui/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../layui/js/fy.js"></script>
	<script type="text/javascript" src="../../layui/layui/layer.ext.js"></script>
	<script type="text/javascript" src="../../layui/lay/modules/layer.js"></script>
	<!-- JQuery 的遮罩层 -->
	<style type="text/css">     
    .mask {       
            position: absolute; top: 0px; filter: alpha(opacity=60); 
            z-index: 1002; left: 0px;              
			background:url(../../layui/layui/img/jz.gif) no-repeat center rgba(0,0,0,0.5) ;
		  	background-size:30px 30px;
			background-repeat: no-repeat;
			background: 
        }     
	</style>   
</head>
<body class="childrenBody">
	<div align="center" id="mask" class="mask"></div>  
	<blockquote class="layui-elem-quote title">我的贷款信息</blockquote>
	<div ng-app="myApp" ng-controller="customersCtrl" align="center">
	<div class="layui-form news_list">
	  	<table class="layui-table">
				<tr style="background-color:#f1f1f1">
					<td>借款人姓名</td>
					<td ng-hide="true"></td>
					<!-- <td>借款人证件号</td> -->
					<td style="text-align: right;">合同贷款金额</td>
					<td>贷款期数</td>
					<td>贷款发放日期</td>
					<td>贷款结清日期</td>
					<td>合同编号</td>
					<td>贷款状态</td>
					<td ng-hide="true"></td>
					<td>操作</td>
				</tr> 
		    	<tr ng-repeat="x in names" align="center" >
				<td >{{ x.JKRXM }}</td>
				<td ng-hide="true">{{ x.JKRZJH }}</td>
				<td style="text-align: right;">{{ x.HTDKJE | currency:"￥"}}</td>
				<td >{{ x.DKQS }}</td>
				<td >{{ x.DKFFRQ }}</td>
				<td >{{ x.DKJQRQ }}</td>
				<td >{{ x.JKHTBH }}</td>
				<td >{{ x.DKSTATUS}}</td>
				<td ng-hide="true">{{ x.YWLSH}}</td><!-- ng-hide="true" --><!-- ng-hide="true" -->
				<td ng-hide="true">{{ x.DKZH}}</td><!-- ng-hide="true" -->
				<td ng-if="x.DKSTATUS == '还款中'">			
					<a class="layui-btn layui-btn-normal layui-btn-xs" onclick="zxhk()">在线还款</a>
					<a class="layui-btn layui-btn-warm layui-btn-xs" onclick="yuqi(this)">逾期记录</a>
					<a class="layui-btn" onclick="bfhd(this)">部分还贷</a>
					<a class="layui-btn layui-btn-danger layui-btn-xs" onclick="hkjl(this)">还款记录</a>
					<a ng-if="x.SFWT == '0'" class="layui-btn layui-btn-xs" onclick="wtzy(this)">逐月申请</a>
				</td>
				<td ng-if="x.DKSTATUS == '结清贷款'">
					<a class="layui-btn layui-btn-warm layui-btn-xs" onclick="yuqi(this)">逾期记录</a>
					<a class="layui-btn layui-btn-danger layui-btn-xs" onclick="hkjl(this)">还款记录</a>
					<a class="layui-btn layui-btn-normal layui-btn-xs" onclick="dyzm(this)">结清打印证明</a>
				</td>
				<td ng-if="x.DKSTATUS != '结清贷款' && x.DKSTATUS != '还款中'">
					<a class="layui-btn layui-btn-primary layui-btn-xs" >审批进度</a>
				</td>
			</tr>
		</table>
		</div>
	</div>
	<script type="text/javascript" src="../../layui/layui/jquery-3.2.1.min.js"></script>
	<script type="text/javascript">
		function s(){     
        $("#mask").css("height",$(document).height());     
        $("#mask").css("width",$(document).width());     
        $("#mask").show();     
	    }  
	    //隐藏遮罩层  
	    function h(){     
	          
	        $("#mask").hide();     
	    }  
	</script>
	<script type="text/javascript" src="../../layui/layui/layui.js"></script>
	<script>
		layui.use('layer', function(){
  			var layer = layui.layer;
		});              
	</script>
	<script>
			var a;
			var app = angular.module('myApp', []);
		    app.controller('customersCtrl', function($scope, $http) {
		    s();
			$http.get(getPath() + "/wsyyt/lishicontroller/test").then(
					function(res) {
					h();
						$scope.data = res.data.data;//自己打断点看格式:[{},{}]
						
						   if(res.data.msg==null){
								
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 
							}else if(res.data.code==1){
									//layer.msg('提示：'+res.data.CW,{icon: 5});	
									layer.alert('提示：'+res.data.CW, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});
									return null;
								}
								console.log(res);	
								a = res.data.CNT;
								feny($scope.data);
								setTimeout(function(){
								$("#test tr:odd").attr("style","background:white"); 						
								$("#test tr:even").attr("style","background:#f1f1f1"); 
								},1000);
														
						});	
			});
		</script>
		<script type="text/javascript">
			 //===逾期信息===//
			function yuqi(obj) {
				var x = $(obj).parent().parent().find("td");  
				var y = x.eq(8).text();
				layer.open({
	            type: 2,
	            title: false,
	            closeBtn: 0, //不显示关闭按钮
	            shade: [0],
	            area: ['0px', '0px'],
	            offset: 'auto', //右下角弹出
	            time: 1, 
	            content: ['test/guodu.html', 'no'], //iframe的url，no代表不显示滚动条
	            end: function(){ //此处用于演示
		                layer.open({
		                    type: 2,
		                    title: '逾期信息',
		                    shadeClose: true,
		                    shade: false,
		                    maxmin: true, //开启最大化最小化按钮
		                    area: ['100%', '100%'],
		                    content: getPath()+'/wsyyt/grwsyyt/gr/wddk/yqxx.html?word='+y
		                });
	            	}	
	        	});
		    };
		     //===在线还款===//
			function zxhk() {
				layer.open({
	            type: 2,
	            title: false,
	            closeBtn: 0, //不显示关闭按钮
	            shade: [0],
	            area: ['0px', '0px'],
	            offset: 'auto', //右下角弹出
	            time: 1, 
	            content: ['test/guodu.html', 'no'], //iframe的url，no代表不显示滚动条
	            end: function(){ //此处用于演示
		                layer.open({
		                    type: 2,
		                    title: '在线还款',
		                    shadeClose: true,
		                    shade: false,
		                    maxmin: true, //开启最大化最小化按钮
		                    area: ['100%', '100%'],
		                    content: getPath()+'/wsyyt/grwsyyt/gr/wddk/zxhk.html'
		                });
	            	}	
	        	});
		    };
		      //===还款记录===//
			function hkjl(obj) {
				var x = $(obj).parent().parent().find("td");  
				var y = x.eq(8).text();
				layer.open({
	            type: 2,
	            title: false,
	            closeBtn: 0, //不显示关闭按钮
	            shade: [0],
	            area: ['0px', '0px'],
	            offset: 'auto', //右下角弹出
	            time: 1, 
	            content: ['test/guodu.html', 'no'], //iframe的url，no代表不显示滚动条
	            end: function(){ //此处用于演示
		                layer.open({
		                    type: 2,
		                    title: '还款记录',
		                    shadeClose: true,
		                    shade: false,
		                    maxmin: true, //开启最大化最小化按钮
		                    area: ['100%', '100%'],
		                    content: getPath()+'/wsyyt/grwsyyt/gr/wddk/hkmx.html?word='+y
		                });
	            	}	
	        	});
		    };
		     //===委托逐月===//
			function wtzy(obj) {
			var x = $(obj).parent().parent().find("td");  
			var y = x.eq(8).text();
				$.ajax({
				url : getPath()+'/wsyyt/wtzycontroller/test3',
				method : 'post',
				dataType : 'JSON',
				data : {
							'YWLSH' : y
						},
				success : function(result) {
					if(result.code=="1"){
					layer.alert('提示：您当前有未归还贷款、不能进行委托逐月！', {
							      skin: 'layui-layer-molv' //样式类名  自定义样式
							     ,closeBtn: 1    // 是否显示关闭按钮
							      ,anim: 1 //动画类型
							     ,btn: ['确认'] //按钮
							      ,icon: 5    // icon
							     ,btn2:function(){
									
									}});
									return null;	
					}else{
						layer.open({
			            type: 2,
			            title: false,
			            closeBtn: 0, //不显示关闭按钮
			            shade: [0],
			            area: ['0px', '0px'],
			            offset: 'auto', //右下角弹出
			            time: 1, 
			            content: ['test/guodu.html', 'no'], //iframe的url，no代表不显示滚动条
			            end: function(){ //此处用于演示
				                layer.open({
				                    type: 2,
				                    title: '委托逐月',
				                    shadeClose: true,
				                    shade: false,
				                    maxmin: true, //开启最大化最小化按钮
				                    area: ['100%', '100%'],
				                    content: getPath()+'/wsyyt/grwsyyt/gr/wddk/wtzy.html'
				                });
			            	}	
			        	});
					}
				}
			});
		}
		    //===部分还贷===//
		    function bfhd(obj) {
				$.ajax({
				url : getPath()+'/wsyyt/zxhkcontroller/test',
				method : 'post',
				dataType : 'JSON',
				success : function(result) {
					if(result.code=="0"){
					layer.alert('提示：您当前有未归还贷款、不能进行部分还贷！', {
							      skin: 'layui-layer-molv' //样式类名  自定义样式
							     ,closeBtn: 1    // 是否显示关闭按钮
							      ,anim: 1 //动画类型
							     ,btn: ['确认'] //按钮
							      ,icon: 5    // icon
							     ,btn2:function(){
									
									}});
									return null;	
					}else{
						var x = $(obj).parent().parent().find("td");  
						var y = x.eq(9).text();
						layer.open({
			            type: 2,
			            title: false,
			            closeBtn: 0, //不显示关闭按钮
			            shade: [0],
			            area: ['0px', '0px'],
			            offset: 'auto', //右下角弹出
			            time: 1, 
			            content: ['test/guodu.html', 'no'], //iframe的url，no代表不显示滚动条
			            end: function(){ //此处用于演示
				                layer.open({
				                    type: 2,
				                    title: '部分还贷',
				                    shadeClose: true,
				                    shade: false,
				                    maxmin: true, //开启最大化最小化按钮
				                    area: ['100%', '100%'],
				                    content: getPath()+'/wsyyt/page/gjj/bfhd.html?word='+y
				                });
			            	}	
			        	});
					}
				}
			});
				
		    };
		   function dyzm(obj) {
				var x = $(obj).parent().parent().find("td");  
				var y = x.eq(8).text();
				layer.open({
	            type: 2,
	            title: false,
	            closeBtn: 0, //不显示关闭按钮
	            shade: [0],
	            area: ['0px', '0px'],
	            offset: 'auto', //右下角弹出
	            time: 1, 
	            content: ['test/guodu.html', 'no'], //iframe的url，no代表不显示滚动条
	            end: function(){ //此处用于演示
		                layer.open({
		                    type: 2,
		                    title: '结清打印证明',
		                    shadeClose: true,
		                    shade: false,
		                    maxmin: true, //开启最大化最小化按钮
		                    area: ['100%', '100%'],
		                    content: getPath()+'/wsyyt/page/gjj/dkdyzm.html?id='+y
		                });
	            	}	
	        	});
		    };
		</script>
		
</body>
</html>